package com.wxc.controller;

import com.wxc.vo.REnum;
import com.wxc.vo.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author wxc
 * @date 2021年10月24日 19:38
 */
@RequestMapping("/error")
@Slf4j
@RestController
@Api("处理过滤器中的错误")
public class ErrorController {

    @GetMapping("/shiroFilter")
    @ApiOperation("处理shiroFilter请求转发")
    public Resp<REnum> shiroFilterError(HttpServletRequest request) {
        return (Resp<REnum>) request.getAttribute("error");
    }
}
